package lolbatfsm.system;

import java.io.Serializable;

/**
 * This class is the equivalence class for the sinchronous transitions.
 * @author Matteo Battaglio <madbat87@gmail.com>
 */
public class EquivalenceClass implements Serializable, Comparable<EquivalenceClass> {

    private final Integer duration;
    private final String name;

    /**
     * Instantiates a new EquivalenceClass whith the specified name and duration.
     * @param name the name of this equivalence class
     * @param duration the duration of the transitions belonging to this equivalence class
     */
    public EquivalenceClass(String name, Integer duration) {
        this.name = name;
        this.duration = duration;
    }

    public Integer getDuration() {
        return this.duration;
    }

    public String getName() {
        return this.name;
    }

    public int compareTo(EquivalenceClass o) {
        return name.compareTo(o.getName());
    }
    
}
